package com.kang.servlet;

import com.kang.dao.impl.water_purifierDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by lenovo on 2018/8/13.
 * 商品状态Servlet
 */
@WebServlet(name = "StateWaterServlet")
public class StateWaterServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        request.setCharacterEncoding("utf-8");
        water_purifierDaoImpl wp=new water_purifierDaoImpl();
        int falg=Integer.parseInt(request.getParameter("falg"));
        int wpid=Integer.parseInt(request.getParameter("wpid"));
        int i=new water_purifierDaoImpl().updataStartUsing(falg,wpid);
        out.print(i);
        out.flush();
        out.close();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
